#include <iostream>
#include <ctime>
using namespace std;
void quickSort(int arr[], int L, int R)
{
	if (L > R)return;
	int pivot = arr[L];
	int left = L;
	int right = R;
	while (left <= right)
	{
		if (arr[left] <= pivot)
		{
			left++;
		}
		else
		{
			int tmp = arr[left];
			arr[left] = arr[right];
			arr[right] = tmp;
			right--;
		}
	}
	int tmp = arr[right];
	arr[right] = arr[L];
	arr[L] = tmp;
	quickSort(arr, L, right - 1);
	quickSort(arr, right + 1, R);
}
int main()
{
	int arr[] = { 45 ,30 ,36 ,29 ,22 ,7 ,33 ,49 ,24 ,44 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	quickSort(arr, 0, sz - 1);
	for (int i = 0; i < sz; i++)
	{
		cout << arr[i] << " ";
	}
}